static char *hdopopt = NULL;
static char *vdopopt = NULL;
static char *andopt = NULL;
+static char *satopt = NULL;
static double hdopf;
static double vdopf;
+static int satpf;
static gpsdata_type what;
static route_head *head;
"-1.0", ARGTYPE_END_REQ | ARGTYPE_FLOAT, ARG_NOMINMAX},
{"hdopandvdop", &andopt, "Link hdop and vdop supression with AND",
NULL, ARGTYPE_BOOL, ARG_NOMINMAX},
+ {"sat", &satopt, "Minimium sats to keep waypoints",
+ "-1.0", ARGTYPE_BEGIN_REQ | ARGTYPE_INT, ARG_NOMINMAX},
ARG_TERMINATOR
};
int del = 0;
int delh = 0;
int delv = 0;
+
waypoint *waypointp = (waypoint *) wpt;
if ((hdopf >= 0.0) && (waypointp->hdop > hdopf))
del = delh && delv;
else
del = delh || delv;
+
+ if ((satpf >= 0) && (waypointp->sat < satpf))
+ del = 1;
if (del) {
switch(what) {
vdopf = atof(vdopopt);
else
vdopf = -1.0;
+
+ if (satopt)
+ satpf = atoi(satopt);
+ else
+ satpf = -1;
+
}
filter_vecs_t discard_vecs = {
<para>
This filter is used to "fix" unreliable GPS data by discarding points
-with HDOP and/or VDOP above a specified limit. HDOP and VDOP are
-measures of the best possible horizontal or vertical precision
-for a given configuration of GPS satellites.
+that are believed to be unreliable. You may specify an
+HDOP and/or VDOP above a specified limit, a minimum number of satellits
+that must have been in view for a fix to be considered, or both.
</para>
+<para>
+HDOP and VDOP are measures of the best possible horizontal or vertical precision for a given configuration of GPS satellites. Higher numbers indicate a higher dilution of precision and therefore mathematically less useful.
+</para>
+<para>
<example id="example_discard_filter">
-<title>Using the discard filter</title>
+<title>Using the discard filter for HDOP and VDOP. </title>
<para><userinput> gpsbabel -i gpx -f in.gpx -x discard,hdop=10,vdop=20,hdopandvdop -o gpx -F out.gpx</userinput></para>
</example>
-<para> Contributed by Tobias Minich.</para>
+</para>
+<para>
+You may specify a minimmum number of satellites.
+</para>
+<para>
+<example id="example_discard_filter_sats">
+<title>Using the discard filter to require at least three satellites. </title>
+<para><userinput> gpsbabel -i gpx -f in.gpx -x discard,sat=3 -o gpx -F out.gpx</userinput></para>
+</example>
+</para>
+<para> Contributed by Tobias Minich and Serge Droz. </para>